﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Shared/Site.Master" AutoEventWireup="true" CodeBehind="EmployeeList.aspx.cs" Inherits="Presentation.Web.Pages.Employee.EmployeeList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Employee List
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <h2>Search</h2>
    <table>
        <tr>
            <th><label for="Name">Name:</label></th>
            <th><asp:TextBox ID="txtName" runat="server" /></th>
        </tr>
    </table>    
    
    <p>
        <asp:Button ID="btnSearch" runat="server" Text="Search" 
            onclick="btnSearch_Click" />
       
        <asp:Button ID="btnReport" runat="server" Text="Report" 
            onclick="btnReport_Click" />
    </p>
    <div>
        <h2>Employee List</h2>
    </div>
    <div style =" padding:10px">
        <asp:DataGrid ID="dgrEmployees" Width="100%" runat="server" ShowHeader="true" 
                    CssClass="GridTranslate" AutoGenerateColumns="False" onitemcommand="dgrEmployees_ItemCommand">
            <Columns>
                <asp:TemplateColumn ItemStyle-Width="20px" HeaderStyle-Font-Bold="true">
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText = "Name" HeaderStyle-Width = "300" HeaderStyle-Font-Bold = "true" HeaderStyle-HorizontalAlign = "Center" ItemStyle-Wrap ="true">
                    <ItemTemplate>
                        <asp:LinkButton ID = "lbnName" runat = "server" Text ='<%# (string)Eval("Name") %>' CommandName="Edit" CommandArgument='<%# Eval("ID") %>'/>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText = "Description" HeaderStyle-Width = "700" HeaderStyle-Font-Bold = "true" HeaderStyle-HorizontalAlign = "Center" 
                                    ItemStyle-HorizontalAlign = "Left" ItemStyle-Wrap ="true">
                    <ItemTemplate>
                        <asp:Label ID = "lblDescription" runat = "server" Text = '<%# Eval("Description") %>' />
                    </ItemTemplate>
                </asp:TemplateColumn>
                <%--<asp:TemplateColumn HeaderText = "Alias" HeaderStyle-Width = "700" HeaderStyle-Font-Bold = "true" HeaderStyle-HorizontalAlign = "Center" 
                                    ItemStyle-HorizontalAlign = "Left" ItemStyle-Wrap ="true">
                    <ItemTemplate>
                        <asp:Label ID = "lblAlias" runat = "server" Text = '<%# Eval("Alias") %>' />
                    </ItemTemplate>
                </asp:TemplateColumn>--%>
                 <asp:TemplateColumn HeaderText="Delete" ItemStyle-Width="100" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" HeaderStyle-Font-Bold="true">
                    <ItemTemplate>
                        <asp:Button ID="btnDelete" runat="server" Text='Delete' OnClientClick="return window.confirm('Are you sure to delete?');"
                            CommandName="Delete" CommandArgument='<%# Eval("ID") %>'/>
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
        </asp:DataGrid>
    </div>
    <div style =" padding:10px">
        <asp:Button ID ="btnAdd" runat = "server" Text = "Add" onclick = "btnAdd_Click" />
    </div>
</asp:Content>
